###########################################################
###                    Glare3D D3D11                    ###
###########################################################

if (ANDROID)
	return()
endif ()

# set some CMake module paths
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/__CMake__)

# enable Folders4CMake
set (folders4cmake_path ${CMAKE_SOURCE_DIR}/__CMake__/folders4cmake.jar)
include (folders4cmake)

# include the source file list generated by Folders4CMake
include (glare.d3d11_src_files)

set (INCLUDE_DIRS
	${CFG_FILE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/Libraries/glare.math/include
    ${CMAKE_SOURCE_DIR}/Libraries/glare.core/include
	${DEPENDENCY_DIRECTX_INCLUDE_DIR}
)

set (LIBRARIES
    glare.core
	dxgi.lib
	d3d11.lib
)

# only include those libraries if we don't need to pass Win-AppStore tests
if (WIN32 AND NOT GLARE3D_WIN8_APPSTORE_CLEAN)
	set (LIBRARIES 
		${LIBRARIES}
		d3dcompiler.lib
		dxguid.lib
	)
endif ()

include_directories(${INCLUDE_DIRS})

add_library(glare.d3d11 STATIC ${file_root})
set_property(TARGET glare.d3d11 PROPERTY FOLDER ${PROJECT_LIBRARIES_FOLDER})

auto_rebuild_src_files (glare.d3d11)

target_link_libraries(glare.d3d11 ${LIBRARIES})
